package com.ysjy.course.model;

import com.fasterxml.jackson.annotation.JsonInclude;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.io.Serializable;

@Data
@ApiModel("课程经营报表")
@JsonInclude(JsonInclude.Include.NON_NULL)
public class OrgDto implements Serializable {

    @ApiModelProperty("id")
    private Long orgId;
    @ApiModelProperty("名称")
    private String orgName;
    @ApiModelProperty(value = "兴趣课数量")
    private int courseNum;
    @ApiModelProperty(value = "托管课数量")
    private int trusteeshipNum;

    @ApiModelProperty("订单数量")
    private int orderNum;
    @ApiModelProperty("线上收费金额（分）")
    private int onlineTotalAmout;
    @ApiModelProperty("线上退款金额（分）")
    private int onlineTotalRefundAmout;
    @ApiModelProperty("线下收费金额（分）")
    private int offlineTotalAmout;
    @ApiModelProperty("线下退款金额（分）")
    private int offlineTotalRefundAmout;


    private BusinessReport businessReport;
    private String startDate;
    private String endDate;

    public void initSet() {
        if (businessReport == null){
            orderNum = 0;
            onlineTotalAmout = 0;
            onlineTotalRefundAmout = 0;
            offlineTotalAmout = 0;
            offlineTotalRefundAmout = 0;
        }else {
            orderNum = businessReport.getOrderNum();
            onlineTotalAmout = businessReport.getOnlineTotalAmout();
            onlineTotalRefundAmout = businessReport.getOnlineTotalRefundAmout();
            offlineTotalAmout = businessReport.getOfflineTotalAmout();
            offlineTotalRefundAmout = businessReport.getOfflineTotalRefundAmout();
        }
        setStartDate(null);
        setEndDate(null);
        setBusinessReport(null);
    }
}